package com.thinkingcoder.tccache.core.command.common;

import static com.thinkingcoder.tccache.constant.CommandConstants.CommonCmd.INFO;
import static com.thinkingcoder.tccache.constant.EncodeConstants.CRLF;

import com.thinkingcoder.tccache.core.command.Command;
import com.thinkingcoder.tccache.core.model.Reply;
import com.thinkingcoder.tccache.core.TcCache;

/**
 * INFO command.
 */
public class InfoCmd implements Command {

    private static final String INFO_RET =
        "TcCache Server[v1.0.0], created by ThinkingCoder." + CRLF + "Mock Redis Server, at 2024-06-19 in WH." + CRLF;

    @Override
    public String name() {
        return INFO;
    }

    @Override
    public Reply<?> exec(TcCache cache, String[] args) {
        return Reply.bulkString(INFO_RET);
    }
}
